package workgroup.osaka;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class AlarmDBHelper extends SQLiteOpenHelper {
    private static final int DB_VERSION = 1;
    private static final String DB_NAME = "alarm.db";
    private static final String CREATE_ALARM_TABLE =
            "create table alarm_table("
            + "_id              integer primary key autoincrement,"
            + "alarmTime        text not null,"
            + "repeatingDay     text not null,"
            + "snoozeInterval   int not null,"
            + "holidayAlarmStop int not null,"     // 1:祝日に鳴らす 0:祝日による制約なし
            + "alarmVol         int not null,"
            + "vibration        int not null,"     // 1:バイブレーションON 0:バイブレーションOFF
            + "alarmOn          int not null,"    // 1:アラームON 0:アラームOFF
            + "systemTime       long not null)";  //システム日時(long)(ソートに使用)

    public AlarmDBHelper(Context context) {
        super(context, DB_NAME, null, DB_VERSION);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL(CREATE_ALARM_TABLE);        
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        // TODO データベースの変更が生じた場合にここに処理を記述。  
    }

}
